package com.xywh.emergency_outbound.mvp.ui.activity;

import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;

import com.xywh.emergency_outbound.R;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isEnabled;
import static android.support.test.espresso.matcher.ViewMatchers.withId;

/**
 * @author 小星 QQ:753940262
 * @class describe
 * @time 2019/11/12 0012 14:29
 */
@RunWith(AndroidJUnit4.class)
@LargeTest
public class LoginActivityTest {
    @Rule
    public ActivityTestRule<LoginActivity> mActivityRule = new ActivityTestRule<>(LoginActivity.class);


    @Test
    public void onViewClicked() {


        String USERNAME = "yjcly";
        onView(withId(R.id.xet_account)).perform(typeText(USERNAME), closeSoftKeyboard());


        String PASSWORD = "test1";
        onView(withId(R.id.xet_pwd)).perform(typeText(PASSWORD), closeSoftKeyboard());
        onView(withId(R.id.btn_login)).check(matches(isEnabled()));

    }
}